export const ensureArray = <T>(arr: T | ReadonlyArray<T>): T[] => {
  if (arr == null) return []
  return Array.isArray(arr) ? arr : [arr] as T[]
}
